section .text
    GLOBAL  _io_hlt
    GLOBAL  _write_mem8
    GLOBAL  _read_eflags,_write_eflags
    GLOBAL  _disable_interrupt,_enable_interrupt
        

_io_hlt: 
    HLT
    RET

_write_mem8:
    MOV     EDX, [ESP+4]  ; port
    MOV     AL, [ESP+8]   ; data
    OUT     DX, AL
    RET

_disable_interrupt:
    CLI
    RET

_enable_interrupt:
    STI
    RET

_read_eflags:
    PUSHFD 
    POP  EAX
    RET

_write_eflags:
    MOV  EAX,[ESP+4]
    PUSH EAX
    POPFD
    RET